package com.zj.z11select.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zj.z11select.entity.ShoppingCart;
import com.zj.z11select.mapper.ShoppingCartMapper;
import com.zj.z11select.secruity.service.TokenService;
import com.zj.z11select.service.ShoppingCartService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 购物车  服务实现类
 * </p>
 *
 * @author ZHOUJIE
 * @since 2021-08-03
 */
@Service
public class ShoppingCartServiceImpl extends ServiceImpl<ShoppingCartMapper, ShoppingCart> implements ShoppingCartService {

    @Resource
    private TokenService tokenService;

    @Resource
    private ShoppingCartMapper shoppingCartMapper;

    @Override
    public List<ShoppingCart> listCart(Integer userId) {
        return this.shoppingCartMapper.selectList(new QueryWrapper<ShoppingCart>().eq("user_id", userId));
    }


}
